// 150. 逆波兰表达式求值
class Solution {
public:
    int evalRPN(vector<string>& tokens) {
        stack<int> st;
        for(auto e : tokens)
        {
            if(e == "+" || e == "-" || e == "*" || e == "/")
            {
                int right = st.top();
                st.pop();
                int left = st.top();
                st.pop();
                switch(e[0])
                {
                case '+': st.push(left + right);break;
                case '-': st.push(left - right);break;
                case '*': st.push(left * right);break;
                case '/': st.push(left / right);break;
                }
            }
            else
            {
                st.push(stoi(e));
            }
        }
        return st.top();
    }
};

// 面试题 01.01. 判定字符是否唯一
class Solution {
public:
    int map[26] = {0};
    bool isUnique(string astr) {
        for(auto e : astr)
        {
            map[e - 'a']++;
        }
        for(int i = 0; i < 26; i++)
        {
            if(map[i] > 1) return false;
        }
        return true;
    }
};